Open
Conversation
…unctionality out of slack.rb
…toring made it so previously passing tests are now failing. need to refactor tests.
…d puts statements to driver code
dHelmgren
reviewed
Oct 1, 2019
|
|
||
| def initialize | ||
| @users = SlackCLI::User.json_parse(SlackCLI::User.get(USER_URL, query: GET_PARAMETERS)) | ||
| @channels = SlackCLI::Channel.json_parse(SlackCLI::Channel.get(CHANNEL_URL, query: GET_PARAMETERS)) |
There was a problem hiding this comment.
What if these come back with errors? You don't give any useful error messaging so I know what needs to be fixed!
| end | ||
|
|
||
| def select_user(user_chosen) | ||
| selected_user = @users.find { |user| user.slack_id == user_chosen || user.name == user_chosen } |
There was a problem hiding this comment.
/Users/devin/Documents/Ada/c12/slack-cli/lib/workspace.rb:58: warning: assigned but unused variable - selected_user
selected_user doesn't actually do anything here.
There was a problem hiding this comment.
If this is a return value, be explicit about that, and don't instantiate a var that won't be used.
| attr_accessor :users, :channels, :selected | ||
|
|
||
| CHANNEL_URL = 'https://slack.com/api/channels.list' | ||
| USER_URL = 'https://slack.com/api/users.list' |
There was a problem hiding this comment.
I'd put these urls in the respective classes, but that is just me being picky.
slack.rbWhat We're Looking For
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions